package com.danco.training.serialization;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;



import com.danco.training.property.PropertyAccess;

public class FileSaverUtil {

	
	public static void save(Object o){
	try{
		String fileName = PropertyAccess.getSerializationFile();
		
		// write objects to file
		FileOutputStream os = new FileOutputStream(fileName);
		ObjectOutputStream oos = new ObjectOutputStream(os);
		oos.writeObject(o);
		
		
		
		//oos.reset();
		
		// close stream
		// it is enought to close only filter stream
		oos.close();
		os.close();
		//read objects
	}
catch(IOException e){
	e.printStackTrace();
	}
}
}
